package ooday04;
/** 狗 */
public class Dog extends Animal implements Swim { //要先继承后实现，多个接口的实现在接口名后面用,隔开
    Dog(String name,int age,String color){
        super(name,age,color);
    }

    void eat(){
        System.out.println(getAge()+"岁的"+getColor()+"色的"+getName()+"在吃骨头");
    }

    void lookHome(){
        System.out.println(getAge()+"岁的"+getColor()+"色的"+getName()+"在看家");
    }

    public void swim(){ //重写接口的抽象方法必须加public
        System.out.println(getAge()+"岁的"+getColor()+"色的"+getName()+"在游泳");
    }
}
